/*
'===============================================================================
'  Generated From - CSharp_EasyObject_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL      = SQL_DAAB_StoredProcs.vbgen
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easily done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.3)

using System;
using System.Data;
using System.Data.Common;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

using Microsoft.Practices.EnterpriseLibrary.Data;
using NCI.EasyObjects;

namespace CMS.DAL
{

	#region Schema

	public class HotelBookingSchema : NCI.EasyObjects.Schema
	{
		private static ArrayList _entries;
		public static SchemaItem HotelBookingID = new SchemaItem("HotelBookingID", DbType.Int32, true, false, false, true, false, false);
		public static SchemaItem HotelID = new SchemaItem("HotelID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem FullName = new SchemaItem("FullName", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem CountryID = new SchemaItem("CountryID", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem Email = new SchemaItem("Email", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem Phone = new SchemaItem("Phone", DbType.String, SchemaItemJustify.None, 250, true, false, false, false);
		public static SchemaItem RoomClass = new SchemaItem("RoomClass", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem NumberOfRoom = new SchemaItem("NumberOfRoom", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem NumberOfExtraBed = new SchemaItem("NumberOfExtraBed", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem CheckIn = new SchemaItem("CheckIn", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem CheckOut = new SchemaItem("CheckOut", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem QuestionsAndComments = new SchemaItem("QuestionsAndComments", DbType.String, SchemaItemJustify.None, 1073741823, true, false, false, false);
		public static SchemaItem Status = new SchemaItem("Status", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem BookingDate = new SchemaItem("BookingDate", DbType.Int32, false, true, false, false, false, false);
		public static SchemaItem PaymentID = new SchemaItem("PaymentID", DbType.Int32, false, true, false, false, false, false);

		public override ArrayList SchemaEntries
		{
			get
			{
				if (_entries == null )
				{
					_entries = new ArrayList();
					_entries.Add(HotelBookingSchema.HotelBookingID);
					_entries.Add(HotelBookingSchema.HotelID);
					_entries.Add(HotelBookingSchema.FullName);
					_entries.Add(HotelBookingSchema.CountryID);
					_entries.Add(HotelBookingSchema.Email);
					_entries.Add(HotelBookingSchema.Phone);
					_entries.Add(HotelBookingSchema.RoomClass);
					_entries.Add(HotelBookingSchema.NumberOfRoom);
					_entries.Add(HotelBookingSchema.NumberOfExtraBed);
					_entries.Add(HotelBookingSchema.CheckIn);
					_entries.Add(HotelBookingSchema.CheckOut);
					_entries.Add(HotelBookingSchema.QuestionsAndComments);
					_entries.Add(HotelBookingSchema.Status);
					_entries.Add(HotelBookingSchema.BookingDate);
					_entries.Add(HotelBookingSchema.PaymentID);
				}
				return _entries;
			}
		}
		
		public static bool HasAutoKey 
		{
			get { return true;	}
		}

		public static bool HasRowID 
		{
			get { return false;	}
		}
	}
	#endregion

	public abstract class _HotelBooking : EasyObject
	{

		public _HotelBooking()
		{
			HotelBookingSchema _schema = new HotelBookingSchema();
			this.SchemaEntries = _schema.SchemaEntries;
			this.SchemaGlobal = "dbo";
		}
		
		public override void FlushData() 	 
		{ 	 
			this._whereClause = null; 	 
			this._aggregateClause = null; 	 
			base.FlushData(); 	 
		}
			   
		/// <summary>
		/// Loads the business object with info from the database, based on the requested primary key.
		/// </summary>
		/// <param name="HotelBookingID"></param>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadByPrimaryKey(int HotelBookingID)
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					ListDictionary parameters = new ListDictionary();

					// Add in parameters
					parameters.Add(HotelBookingSchema.HotelBookingID.FieldName, HotelBookingID);

					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetHotelBooking", parameters, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.HotelBookingID.Value = HotelBookingID;
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}
	
		/// <summary>
		/// Loads all records from the table.
		/// </summary>
		/// <returns>A Boolean indicating success or failure of the query</returns>
		public bool LoadAll()
		{
			switch(this.DefaultCommandType)
			{
				case CommandType.StoredProcedure:
					return base.LoadFromSql(this.SchemaStoredProcedureWithSeparator + "sp_GetAllHotelBooking", null, CommandType.StoredProcedure);

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					return this.Query.Load();

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		/// <summary>
		/// Adds a new record to the internal table.
		/// </summary>
		public override void AddNew()
		{
			base.AddNew();
			this.ApplyDefaults();
		}

		/// <summary>
		/// Apply any default values to columns
		/// </summary>
		protected override void ApplyDefaults()
		{
		}

		protected override DbCommand GetInsertCommand(CommandType commandType)
		{	
			DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_AddHotelBooking";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddParameter(dbCommand, "HotelBookingID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "HotelBookingID", DataRowVersion.Default, Convert.DBNull);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!item.IsComputed)
						{
							if ((item.IsAutoKey && this.IdentityInsert) || !item.IsAutoKey)
							{
								this.Query.AddInsertColumn(item);
							}
						}
					}
					dbCommand = this.Query.GetInsertCommandWrapper();

					dbCommand.Parameters.Clear();
					if (this.IdentityInsert)
					{
						db.AddInParameter(dbCommand, "HotelBookingID", DbType.Int32, "HotelBookingID", DataRowVersion.Default);
					}
					else
					{
						db.AddParameter(dbCommand, "HotelBookingID", DbType.Int32, 0, ParameterDirection.Output, true, 0, 0, "HotelBookingID", DataRowVersion.Default, Convert.DBNull);
					}
					CreateParameters(db, dbCommand);

					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetUpdateCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_UpdateHotelBooking";
					dbCommand = db.GetStoredProcCommand(sqlCommand);

					db.AddInParameter(dbCommand, "HotelBookingID", DbType.Int32, "HotelBookingID", DataRowVersion.Current);
					CreateParameters(db, dbCommand);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					foreach(SchemaItem item in this.SchemaEntries)
					{
						if (!(item.IsAutoKey || item.IsComputed))
						{
							this.Query.AddUpdateColumn(item);
						}
					}

					this.Where.WhereClauseReset();
					this.Where.HotelBookingID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetUpdateCommandWrapper();

					dbCommand.Parameters.Clear();
					CreateParameters(db, dbCommand);
					db.AddInParameter(dbCommand, "HotelBookingID", DbType.Int32, "HotelBookingID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		protected override DbCommand GetDeleteCommand(CommandType commandType)
		{
            DbCommand dbCommand;

			// Create the Database object, using the default database service. The
			// default database service is determined through configuration.
			Database db = GetDatabase();

			switch(commandType)
			{
				case CommandType.StoredProcedure:
					string sqlCommand = this.SchemaStoredProcedureWithSeparator + "sp_DeleteHotelBooking";
					dbCommand = db.GetStoredProcCommand(sqlCommand);
					db.AddInParameter(dbCommand, "HotelBookingID", DbType.Int32, "HotelBookingID", DataRowVersion.Current);
					
					return dbCommand;

				case CommandType.Text:
					this.Query.ClearAll();
					this.Where.WhereClauseReset();
					this.Where.HotelBookingID.Operator = WhereParameter.Operand.Equal;
					dbCommand = this.Query.GetDeleteCommandWrapper();

					dbCommand.Parameters.Clear();
					db.AddInParameter(dbCommand, "HotelBookingID", DbType.Int32, "HotelBookingID", DataRowVersion.Current);
					
					return dbCommand;

				default:
					throw new ArgumentException("Invalid CommandType", "commandType");
			}
		}

		private void CreateParameters(Database db, DbCommand dbCommand)
		{
			db.AddInParameter(dbCommand, "HotelID", DbType.Int32, "HotelID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "FullName", DbType.String, "FullName", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "CountryID", DbType.Int32, "CountryID", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Email", DbType.String, "Email", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Phone", DbType.String, "Phone", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "RoomClass", DbType.Int32, "RoomClass", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "NumberOfRoom", DbType.Int32, "NumberOfRoom", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "NumberOfExtraBed", DbType.Int32, "NumberOfExtraBed", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "CheckIn", DbType.Int32, "CheckIn", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "CheckOut", DbType.Int32, "CheckOut", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "QuestionsAndComments", DbType.String, "QuestionsAndComments", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "Status", DbType.Int32, "Status", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "BookingDate", DbType.Int32, "BookingDate", DataRowVersion.Current);
			db.AddInParameter(dbCommand, "PaymentID", DbType.Int32, "PaymentID", DataRowVersion.Current);
		}
		
		#region Properties
		public virtual int HotelBookingID
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.HotelBookingID.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.HotelBookingID.FieldName, value);
			}
		}
		public virtual int HotelID
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.HotelID.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.HotelID.FieldName, value);
			}
		}
		public virtual string FullName
		{
			get
			{
				return this.GetString(HotelBookingSchema.FullName.FieldName);
	    	}
			set
			{
				this.SetString(HotelBookingSchema.FullName.FieldName, value);
			}
		}
		public virtual int CountryID
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.CountryID.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.CountryID.FieldName, value);
			}
		}
		public virtual string Email
		{
			get
			{
				return this.GetString(HotelBookingSchema.Email.FieldName);
	    	}
			set
			{
				this.SetString(HotelBookingSchema.Email.FieldName, value);
			}
		}
		public virtual string Phone
		{
			get
			{
				return this.GetString(HotelBookingSchema.Phone.FieldName);
	    	}
			set
			{
				this.SetString(HotelBookingSchema.Phone.FieldName, value);
			}
		}
		public virtual int RoomClass
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.RoomClass.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.RoomClass.FieldName, value);
			}
		}
		public virtual int NumberOfRoom
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.NumberOfRoom.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.NumberOfRoom.FieldName, value);
			}
		}
		public virtual int NumberOfExtraBed
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.NumberOfExtraBed.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.NumberOfExtraBed.FieldName, value);
			}
		}
		public virtual int CheckIn
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.CheckIn.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.CheckIn.FieldName, value);
			}
		}
		public virtual int CheckOut
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.CheckOut.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.CheckOut.FieldName, value);
			}
		}
		public virtual string QuestionsAndComments
		{
			get
			{
				return this.GetString(HotelBookingSchema.QuestionsAndComments.FieldName);
	    	}
			set
			{
				this.SetString(HotelBookingSchema.QuestionsAndComments.FieldName, value);
			}
		}
		public virtual int Status
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.Status.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.Status.FieldName, value);
			}
		}
		public virtual int BookingDate
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.BookingDate.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.BookingDate.FieldName, value);
			}
		}
		public virtual int PaymentID
		{
			get
			{
				return this.GetInteger(HotelBookingSchema.PaymentID.FieldName);
	    	}
			set
			{
				this.SetInteger(HotelBookingSchema.PaymentID.FieldName, value);
			}
		}

		public override string TableName
		{
			get { return "HotelBooking"; }
		}
		
		#endregion		
		
		#region String Properties
		public virtual string s_HotelBookingID
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.HotelBookingID.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.HotelBookingID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.HotelBookingID.FieldName);
			    else
			        this.HotelBookingID = base.SetIntegerAsString(HotelBookingSchema.HotelBookingID.FieldName, value);
			}
		}
		public virtual string s_HotelID
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.HotelID.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.HotelID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.HotelID.FieldName);
			    else
			        this.HotelID = base.SetIntegerAsString(HotelBookingSchema.HotelID.FieldName, value);
			}
		}
		public virtual string s_FullName
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.FullName.FieldName) ? string.Empty : base.GetStringAsString(HotelBookingSchema.FullName.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.FullName.FieldName);
			    else
			        this.FullName = base.SetStringAsString(HotelBookingSchema.FullName.FieldName, value);
			}
		}
		public virtual string s_CountryID
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.CountryID.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.CountryID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.CountryID.FieldName);
			    else
			        this.CountryID = base.SetIntegerAsString(HotelBookingSchema.CountryID.FieldName, value);
			}
		}
		public virtual string s_Email
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.Email.FieldName) ? string.Empty : base.GetStringAsString(HotelBookingSchema.Email.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.Email.FieldName);
			    else
			        this.Email = base.SetStringAsString(HotelBookingSchema.Email.FieldName, value);
			}
		}
		public virtual string s_Phone
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.Phone.FieldName) ? string.Empty : base.GetStringAsString(HotelBookingSchema.Phone.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.Phone.FieldName);
			    else
			        this.Phone = base.SetStringAsString(HotelBookingSchema.Phone.FieldName, value);
			}
		}
		public virtual string s_RoomClass
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.RoomClass.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.RoomClass.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.RoomClass.FieldName);
			    else
			        this.RoomClass = base.SetIntegerAsString(HotelBookingSchema.RoomClass.FieldName, value);
			}
		}
		public virtual string s_NumberOfRoom
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.NumberOfRoom.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.NumberOfRoom.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.NumberOfRoom.FieldName);
			    else
			        this.NumberOfRoom = base.SetIntegerAsString(HotelBookingSchema.NumberOfRoom.FieldName, value);
			}
		}
		public virtual string s_NumberOfExtraBed
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.NumberOfExtraBed.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.NumberOfExtraBed.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.NumberOfExtraBed.FieldName);
			    else
			        this.NumberOfExtraBed = base.SetIntegerAsString(HotelBookingSchema.NumberOfExtraBed.FieldName, value);
			}
		}
		public virtual string s_CheckIn
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.CheckIn.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.CheckIn.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.CheckIn.FieldName);
			    else
			        this.CheckIn = base.SetIntegerAsString(HotelBookingSchema.CheckIn.FieldName, value);
			}
		}
		public virtual string s_CheckOut
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.CheckOut.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.CheckOut.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.CheckOut.FieldName);
			    else
			        this.CheckOut = base.SetIntegerAsString(HotelBookingSchema.CheckOut.FieldName, value);
			}
		}
		public virtual string s_QuestionsAndComments
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.QuestionsAndComments.FieldName) ? string.Empty : base.GetStringAsString(HotelBookingSchema.QuestionsAndComments.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.QuestionsAndComments.FieldName);
			    else
			        this.QuestionsAndComments = base.SetStringAsString(HotelBookingSchema.QuestionsAndComments.FieldName, value);
			}
		}
		public virtual string s_Status
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.Status.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.Status.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.Status.FieldName);
			    else
			        this.Status = base.SetIntegerAsString(HotelBookingSchema.Status.FieldName, value);
			}
		}
		public virtual string s_BookingDate
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.BookingDate.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.BookingDate.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.BookingDate.FieldName);
			    else
			        this.BookingDate = base.SetIntegerAsString(HotelBookingSchema.BookingDate.FieldName, value);
			}
		}
		public virtual string s_PaymentID
		{
			get
			{
			    return this.IsColumnNull(HotelBookingSchema.PaymentID.FieldName) ? string.Empty : base.GetIntegerAsString(HotelBookingSchema.PaymentID.FieldName);
			}
			set
			{
			    if(string.Empty == value)
			        this.SetColumnNull(HotelBookingSchema.PaymentID.FieldName);
			    else
			        this.PaymentID = base.SetIntegerAsString(HotelBookingSchema.PaymentID.FieldName, value);
			}
		}
		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter HotelBookingID
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.HotelBookingID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter HotelID
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.HotelID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter FullName
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.FullName);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter CountryID
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.CountryID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Email
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.Email);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Phone
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.Phone);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter RoomClass
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.RoomClass);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter NumberOfRoom
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.NumberOfRoom);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter NumberOfExtraBed
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.NumberOfExtraBed);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter CheckIn
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.CheckIn);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter CheckOut
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.CheckOut);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter QuestionsAndComments
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.QuestionsAndComments);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter Status
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.Status);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter BookingDate
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.BookingDate);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}

				public WhereParameter PaymentID
				{
					get
					{
							WhereParameter wp = new WhereParameter(HotelBookingSchema.PaymentID);
							this._clause._entity.Query.AddWhereParameter(wp);
							return wp;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter HotelBookingID
		    {
				get
		        {
					if(_HotelBookingID_W == null)
	        	    {
						_HotelBookingID_W = TearOff.HotelBookingID;
					}
					return _HotelBookingID_W;
				}
			}

			public WhereParameter HotelID
		    {
				get
		        {
					if(_HotelID_W == null)
	        	    {
						_HotelID_W = TearOff.HotelID;
					}
					return _HotelID_W;
				}
			}

			public WhereParameter FullName
		    {
				get
		        {
					if(_FullName_W == null)
	        	    {
						_FullName_W = TearOff.FullName;
					}
					return _FullName_W;
				}
			}

			public WhereParameter CountryID
		    {
				get
		        {
					if(_CountryID_W == null)
	        	    {
						_CountryID_W = TearOff.CountryID;
					}
					return _CountryID_W;
				}
			}

			public WhereParameter Email
		    {
				get
		        {
					if(_Email_W == null)
	        	    {
						_Email_W = TearOff.Email;
					}
					return _Email_W;
				}
			}

			public WhereParameter Phone
		    {
				get
		        {
					if(_Phone_W == null)
	        	    {
						_Phone_W = TearOff.Phone;
					}
					return _Phone_W;
				}
			}

			public WhereParameter RoomClass
		    {
				get
		        {
					if(_RoomClass_W == null)
	        	    {
						_RoomClass_W = TearOff.RoomClass;
					}
					return _RoomClass_W;
				}
			}

			public WhereParameter NumberOfRoom
		    {
				get
		        {
					if(_NumberOfRoom_W == null)
	        	    {
						_NumberOfRoom_W = TearOff.NumberOfRoom;
					}
					return _NumberOfRoom_W;
				}
			}

			public WhereParameter NumberOfExtraBed
		    {
				get
		        {
					if(_NumberOfExtraBed_W == null)
	        	    {
						_NumberOfExtraBed_W = TearOff.NumberOfExtraBed;
					}
					return _NumberOfExtraBed_W;
				}
			}

			public WhereParameter CheckIn
		    {
				get
		        {
					if(_CheckIn_W == null)
	        	    {
						_CheckIn_W = TearOff.CheckIn;
					}
					return _CheckIn_W;
				}
			}

			public WhereParameter CheckOut
		    {
				get
		        {
					if(_CheckOut_W == null)
	        	    {
						_CheckOut_W = TearOff.CheckOut;
					}
					return _CheckOut_W;
				}
			}

			public WhereParameter QuestionsAndComments
		    {
				get
		        {
					if(_QuestionsAndComments_W == null)
	        	    {
						_QuestionsAndComments_W = TearOff.QuestionsAndComments;
					}
					return _QuestionsAndComments_W;
				}
			}

			public WhereParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public WhereParameter BookingDate
		    {
				get
		        {
					if(_BookingDate_W == null)
	        	    {
						_BookingDate_W = TearOff.BookingDate;
					}
					return _BookingDate_W;
				}
			}

			public WhereParameter PaymentID
		    {
				get
		        {
					if(_PaymentID_W == null)
	        	    {
						_PaymentID_W = TearOff.PaymentID;
					}
					return _PaymentID_W;
				}
			}

			private WhereParameter _HotelBookingID_W = null;
			private WhereParameter _HotelID_W = null;
			private WhereParameter _FullName_W = null;
			private WhereParameter _CountryID_W = null;
			private WhereParameter _Email_W = null;
			private WhereParameter _Phone_W = null;
			private WhereParameter _RoomClass_W = null;
			private WhereParameter _NumberOfRoom_W = null;
			private WhereParameter _NumberOfExtraBed_W = null;
			private WhereParameter _CheckIn_W = null;
			private WhereParameter _CheckOut_W = null;
			private WhereParameter _QuestionsAndComments_W = null;
			private WhereParameter _Status_W = null;
			private WhereParameter _BookingDate_W = null;
			private WhereParameter _PaymentID_W = null;

			public void WhereClauseReset()
			{
				_HotelBookingID_W = null;
				_HotelID_W = null;
				_FullName_W = null;
				_CountryID_W = null;
				_Email_W = null;
				_Phone_W = null;
				_RoomClass_W = null;
				_NumberOfRoom_W = null;
				_NumberOfExtraBed_W = null;
				_CheckIn_W = null;
				_CheckOut_W = null;
				_QuestionsAndComments_W = null;
				_Status_W = null;
				_BookingDate_W = null;
				_PaymentID_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private EasyObject _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
		
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(EasyObject entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter HotelBookingID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.HotelBookingID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter HotelID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.HotelID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter FullName
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.FullName);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter CountryID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.CountryID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Email
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.Email);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Phone
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.Phone);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter RoomClass
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.RoomClass);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter NumberOfRoom
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.NumberOfRoom);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter NumberOfExtraBed
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.NumberOfExtraBed);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter CheckIn
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.CheckIn);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter CheckOut
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.CheckOut);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter QuestionsAndComments
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.QuestionsAndComments);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter Status
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.Status);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter BookingDate
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.BookingDate);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}

				public AggregateParameter PaymentID
				{
					get
					{
							AggregateParameter ap = new AggregateParameter(HotelBookingSchema.PaymentID);
							this._clause._entity.Query.AddAggregateParameter(ap);
							return ap;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter HotelBookingID
		    {
				get
		        {
					if(_HotelBookingID_W == null)
	        	    {
						_HotelBookingID_W = TearOff.HotelBookingID;
					}
					return _HotelBookingID_W;
				}
			}

			public AggregateParameter HotelID
		    {
				get
		        {
					if(_HotelID_W == null)
	        	    {
						_HotelID_W = TearOff.HotelID;
					}
					return _HotelID_W;
				}
			}

			public AggregateParameter FullName
		    {
				get
		        {
					if(_FullName_W == null)
	        	    {
						_FullName_W = TearOff.FullName;
					}
					return _FullName_W;
				}
			}

			public AggregateParameter CountryID
		    {
				get
		        {
					if(_CountryID_W == null)
	        	    {
						_CountryID_W = TearOff.CountryID;
					}
					return _CountryID_W;
				}
			}

			public AggregateParameter Email
		    {
				get
		        {
					if(_Email_W == null)
	        	    {
						_Email_W = TearOff.Email;
					}
					return _Email_W;
				}
			}

			public AggregateParameter Phone
		    {
				get
		        {
					if(_Phone_W == null)
	        	    {
						_Phone_W = TearOff.Phone;
					}
					return _Phone_W;
				}
			}

			public AggregateParameter RoomClass
		    {
				get
		        {
					if(_RoomClass_W == null)
	        	    {
						_RoomClass_W = TearOff.RoomClass;
					}
					return _RoomClass_W;
				}
			}

			public AggregateParameter NumberOfRoom
		    {
				get
		        {
					if(_NumberOfRoom_W == null)
	        	    {
						_NumberOfRoom_W = TearOff.NumberOfRoom;
					}
					return _NumberOfRoom_W;
				}
			}

			public AggregateParameter NumberOfExtraBed
		    {
				get
		        {
					if(_NumberOfExtraBed_W == null)
	        	    {
						_NumberOfExtraBed_W = TearOff.NumberOfExtraBed;
					}
					return _NumberOfExtraBed_W;
				}
			}

			public AggregateParameter CheckIn
		    {
				get
		        {
					if(_CheckIn_W == null)
	        	    {
						_CheckIn_W = TearOff.CheckIn;
					}
					return _CheckIn_W;
				}
			}

			public AggregateParameter CheckOut
		    {
				get
		        {
					if(_CheckOut_W == null)
	        	    {
						_CheckOut_W = TearOff.CheckOut;
					}
					return _CheckOut_W;
				}
			}

			public AggregateParameter QuestionsAndComments
		    {
				get
		        {
					if(_QuestionsAndComments_W == null)
	        	    {
						_QuestionsAndComments_W = TearOff.QuestionsAndComments;
					}
					return _QuestionsAndComments_W;
				}
			}

			public AggregateParameter Status
		    {
				get
		        {
					if(_Status_W == null)
	        	    {
						_Status_W = TearOff.Status;
					}
					return _Status_W;
				}
			}

			public AggregateParameter BookingDate
		    {
				get
		        {
					if(_BookingDate_W == null)
	        	    {
						_BookingDate_W = TearOff.BookingDate;
					}
					return _BookingDate_W;
				}
			}

			public AggregateParameter PaymentID
		    {
				get
		        {
					if(_PaymentID_W == null)
	        	    {
						_PaymentID_W = TearOff.PaymentID;
					}
					return _PaymentID_W;
				}
			}

			private AggregateParameter _HotelBookingID_W = null;
			private AggregateParameter _HotelID_W = null;
			private AggregateParameter _FullName_W = null;
			private AggregateParameter _CountryID_W = null;
			private AggregateParameter _Email_W = null;
			private AggregateParameter _Phone_W = null;
			private AggregateParameter _RoomClass_W = null;
			private AggregateParameter _NumberOfRoom_W = null;
			private AggregateParameter _NumberOfExtraBed_W = null;
			private AggregateParameter _CheckIn_W = null;
			private AggregateParameter _CheckOut_W = null;
			private AggregateParameter _QuestionsAndComments_W = null;
			private AggregateParameter _Status_W = null;
			private AggregateParameter _BookingDate_W = null;
			private AggregateParameter _PaymentID_W = null;

			public void AggregateClauseReset()
			{
				_HotelBookingID_W = null;
				_HotelID_W = null;
				_FullName_W = null;
				_CountryID_W = null;
				_Email_W = null;
				_Phone_W = null;
				_RoomClass_W = null;
				_NumberOfRoom_W = null;
				_NumberOfExtraBed_W = null;
				_CheckIn_W = null;
				_CheckOut_W = null;
				_QuestionsAndComments_W = null;
				_Status_W = null;
				_BookingDate_W = null;
				_PaymentID_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private EasyObject _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	}
}
